﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;


namespace CustomControl.Resource.Controls
{
    public class MyButton : Button
    {
        public MyButton() //这个一定是需要的，否则在MainWindow.xaml使用该控件的时候，会提示控件未被指定未实例
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(MyButton), new FrameworkPropertyMetadata(typeof(MyButton)));  
        }
        public ImageSource Imsource
        {
            get { return (ImageSource)GetValue(ImsourceProperty); }
            set { SetValue(ImsourceProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Imsource.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ImsourceProperty =
            DependencyProperty.Register("Imsource", typeof(ImageSource), typeof(MyButton), null);

       
    }
    



}
